import request from '@/config/axios'

// 会员期限 VO
export interface MemberDeadlineVO {
  id: number // 主键
  userId: number // 用户id
  startDate: Date // 开通时间
  endDate: Date // 结束时间
  memberTypeId: number // 会员类型id
}

// 会员期限 API
export const MemberDeadlineApi = {
  // 查询会员期限分页
  getMemberDeadlinePage: async (params: any) => {
    return await request.get({ url: `/wine/member-deadline/page`, params })
  },

  // 查询会员期限详情
  getMemberDeadline: async (id: number) => {
    return await request.get({ url: `/wine/member-deadline/get?id=` + id })
  },

  // 新增会员期限
  createMemberDeadline: async (data: MemberDeadlineVO) => {
    return await request.post({ url: `/wine/member-deadline/create`, data })
  },

  // 修改会员期限
  updateMemberDeadline: async (data: MemberDeadlineVO) => {
    return await request.put({ url: `/wine/member-deadline/update`, data })
  },

  // 删除会员期限
  deleteMemberDeadline: async (id: number) => {
    return await request.delete({ url: `/wine/member-deadline/delete?id=` + id })
  },

  // 导出会员期限 Excel
  exportMemberDeadline: async (params) => {
    return await request.download({ url: `/wine/member-deadline/export-excel`, params })
  }
}
